#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main()
{
    FILE *pf;
    pf = fopen("f1.txt", "r");
    if (pf != NULL)
    {
        char c;
        int letternum = 0, digitnum = 0, othernum = 0;
        do
        {
            c = fgetc(pf);
            if (isalpha(c))
                letternum++;
            else if (isdigit(c))
                digitnum++;
            else
                othernum++;
        } while (c != EOF);
        printf("letter=%d,digit=%d,other=%d", letternum, digitnum, othernum);
        fclose(pf);
    }
    return 0;
}